﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace tsgl
{
    public partial class selectBook : Form
    {
        public selectBook()
        {
            InitializeComponent();
        }

        public DataTable dt;
        public string getBookCode()
        {
            return label1.Text.Trim();
        }

        private void selectBook_Load(object sender, EventArgs e)
        {
            dt = bookDbClass.ExecuteDataTable("select bookView.图书条码,bookView.书目编号,bookView.图书名称,bookView.价格,bookView.出版社名称,bookView.作者,bookView.总藏书数量,bookView.现存数量 from bookView,图书信息 where bookView.图书条码=图书信息.图书条码 and 图书信息.图书状态='在藏'");
            //dt = bookDbClass.ExecuteDataTable("select * from bookView");
            this.dataGridView1.DataSource = dt.DefaultView;
            this.label1.Visible = true;
            this.label1.DataBindings.Clear();
            this.label1.DataBindings.Add("text",dt.DefaultView,"图书条码");
            this.label1.Visible = false;
        }

        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Yes;
        }
    }
}